package com.cykj.controller;

import com.cykj.dto.ResponseDTO;
import com.cykj.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: jd-project
 * @BelongsPackage: com.cykj.controller
 * @Author: 小林
 * @CreateTime: 2025-02-25 20:49
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;

    @Value("${server.port}")
    private String port;

    @GetMapping("getHostGoodsToRedis")
    public ResponseDTO getHostGoodsToRedis(){
        return goodsService.getHostGoodsToRedis();
    }

    @RequestMapping("getOption")
    public ResponseDTO getOption(String category,String optionOne,String optionTwo){
        return goodsService.getOption(category,optionOne,optionTwo);
    }
    @RequestMapping("resTemplateTest")
    public String resTemplateTest(){
        System.out.println("商品微服务执行了" +port);
        return "goods run.........";
    }
}

